package com.htl.exampro.exam.api;

import com.htl.exampro.base.model.PageResult;
import com.htl.exampro.base.model.ServerResponse;
import com.htl.exampro.exam.pojo.vo.ExamVO;
import org.springframework.web.bind.annotation.*;

/**
 * 考试管理接口
 */
public interface ExamApi {
    /**
     * 获取考试列表
     */
    @GetMapping("/exam/list")
    ServerResponse<PageResult<ExamVO>> getExamPage(
            @RequestParam(defaultValue = "1") Integer pageNum,
            @RequestParam(defaultValue = "10") Integer pageSize,
            @RequestParam(required = false) String keyword);

    /**
     * 创建考试
     */
    @PostMapping("/exam")
    ServerResponse<Void> createExam(@RequestBody ExamVO exam);

    /**
     * 获取考试详情
     */
    @GetMapping("/exam/{id}")
    ServerResponse<ExamVO> getExamChapter(@PathVariable Long id);

    /**
     * 更新考试
     */
    @PutMapping("/exam")
    ServerResponse<Void> updateExam(@RequestBody ExamVO exam);

    /**
     * 删除考试
     */
    @DeleteMapping("/exam/{id}")
    ServerResponse<Void> deleteExam(@PathVariable Long id);

}